<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button>1</button>
<button>2</button>
</body>
<script>
    const btns = document.querySelectorAll("button");
    function ajax(cb){
        const xhr = new XMLHttpRequest();
        xhr.open("get","./utils/Tag.js");
        xhr.send();
        xhr.onload = function(){
           cb(xhr.response);
        }
    }
    btns[0].onclick = function(){
       ajax(function(response){
           console.log(response)
       });
    }
    btns[1].onclick = function(){
       ajax(function(response){
           alert(response);
       });
    }
</script>
</html>